package com.ly.lypopupwindowdemo.pop;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;

import com.ly.lypopupwindowdemo.R;

import razerdp.basepopup.BasePopupWindow;


/**
 * Created by liying on 2017/5/10.
 */

public class ScalePopup extends BasePopupWindow {

    private View popupView;
    View.OnClickListener listener;

    public ScalePopup(Activity context,View.OnClickListener listener) {
        super(context);
        this.listener = listener;
        bindEvent();

    }

    private void bindEvent() {

        if (popupView!=null){
            popupView.findViewById(R.id.tx_1).setOnClickListener(listener);
            popupView.findViewById(R.id.tx_2).setOnClickListener(listener);
            popupView.findViewById(R.id.tx_3).setOnClickListener(listener);
        }
    }


    @Override
    public View onCreatePopupView() {
        popupView = LayoutInflater.from(getContext()).inflate(R.layout.popup_normal,null);
        return popupView;
    }

    @Override
    public View initAnimaView() {
        return popupView.findViewById(R.id.popup_anima);
    }

    @Override
    protected Animation initShowAnimation() {
        return getDefaultAlphaAnimation();
    }

    @Override
    public View getClickToDismissView() {
        return popupView.findViewById(R.id.click_to_dismiss);
    }


}
